package com.bao.work;

import java.util.Scanner;

/**
 * @author baoye
 * @date 2024-07-23/19:18
 */
public class ExceptionTest02 {
    public static void main(String[] args) {
    Scanner input=new Scanner(System.in);
        System.out.println("请输入三条边");
        int a=input.nextInt();
        int b=input.nextInt();
        int c=input.nextInt();
        isTriangle(a,b,c);
    }
    public static void isTriangle(int a,int b,int c){
        if (a+b<=c||a+c<=b||b+c<=a){
            try {
                throw new IllegalAccessException(a+","+b+","+c+"不能构成三角形");
            } catch (IllegalAccessException e) {
                e.printStackTrace();
            }
        }else{
            System.out.println(a+","+b+","+c+"可以构成三角形");
        }
    }
}
